package com.menggudf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.menggudf.dao.CaseHistoryDao;
import com.menggudf.entity.CaseHistory;
import com.menggudf.service.CaseHistoryService;
/**
 * 病历service
 * @author Administrator
 *
 * @param <T>
 */
@Service
public class CaseHistoryServiceImpl implements CaseHistoryService{

    @Autowired
    private CaseHistoryDao caseHistoryDao;

	@Override
	@Transactional(value = "medicalTM", rollbackFor=Exception.class)
	public void toSaveCaseHis(CaseHistory caseHistory) {
		caseHistoryDao.persist(caseHistory);
	}

	@Override
	@Transactional(value = "medicalTM", readOnly=true)
	public List CaseList(String userCode) {
/*		List caseList;
		StringBuffer sql=new StringBuffer();
		sql.append("select * from casehistory where userCode='"+userCode);
		sql.append("'");
		caseList=baseDao().findBySQL(sql.toString());
		return caseList;*/
	    return null;
	}

	@Override
	@Transactional(value = "medicalTM", readOnly=true)
	public List CaseDetail(int id) {
/*		List dataList;
		StringBuffer sql=new StringBuffer();
		sql.append("select * from casehistory where id="+id);
		dataList=baseDao().findBySQL(sql.toString());
		return dataList;*/
	    return null;
	}

}
